﻿using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.Tools;

namespace Pixysoft.Weblications.Sango.Battle
{
    class RvrSectionTeam
    {
        /// <summary>
        /// 房间编码
        /// </summary>
        long roomcode;
        /// <summary>
        /// 所属地区
        /// </summary>
        Entities.Sys_Section section;
        /// <summary>
        /// 攻击地区
        /// </summary>
        Entities.Sys_Section targetSection;
        /// <summary>
        /// 开战时间
        /// </summary>
        long battledate;
        /// <summary>
        /// 参加战斗人员列表
        /// </summary>
        List<string> profiles = new List<string>();


        public RvrSectionTeam(Entities.Sys_Section section, Entities.Sys_Section targetSection, long battledate)
        {
            this.roomcode = GlobalTimer.Instance.ToTimeSequence();
            this.section = section;
            this.targetSection = targetSection;
            this.battledate = battledate;
        }


        /// <summary>
        /// 加入队伍
        /// </summary>
        /// <param name="usercode"></param>
        public void Join(string usercode)
        {
            if (profiles.Contains(usercode))
                return;

            profiles.Add(usercode);
        }

        /// <summary>
        /// 离开队伍
        /// </summary>
        /// <param name="usercode"></param>
        public void Leave(string usercode)
        {
            if (!profiles.Contains(usercode))
                return;

            profiles.Remove(usercode);
        }

        /// <summary>
        /// 获取队员列表
        /// </summary>
        public string[] Profiles
        {
            get
            {
                return profiles.ToArray();
            }
        }


        public long Roomcode
        {
            get
            {
                return roomcode;
            }
        }

        public long Battledate
        {
            get
            {
                return battledate;
            }
        }

        public Entities.Sys_Section Section
        {
            get
            {
                return this.section;
            }
        }

        public Entities.Sys_Section TargetSection
        {
            get
            {
                return this.targetSection;
            }
        }
    }
}
